<?php
/**
 * @ Fmash Top System
 * @ version: 3.0
 * @ author: i.coffee.smile@mail.com
 * @ date:2011-1-27
 * @ file:class_mysql_uc.php $3
 */
include_once 'define_mysql.php';

//--connect database
$uc_conn = mysql_connect ($uc_mysql_server_name, $uc_mysql_username , $uc_mysql_password);

//--chose database
mysql_select_db($uc_mysql_database,$uc_conn);

//--set names
mysql_query('set names utf8');

//--check user input 
function incheck($sql_str) {
   $check =  eregi('select|insert|update|delete|and|\'|\$|\#|\;|\"|\,|\.|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile', $sql_str);
   if($check){
		header('location: index.php');
		exit();
   }else{
   	return $sql_str;
   }
}

function one2five($str)
{
	if(ereg("^[0-9]*$",$str) && $str > 0 && $str < 6)
	{
		return $str;
	}else{
		return 1;
	}
}
